set JAVA_DIR=%1
set OHM_HOME=%2
set RBNB_PATH=%3
set RBNB_ADDRESS=%4


set ALGSERVER_PATH=%OHM_HOME%\AlgorithmFactory
set RPCPLUGINS_PATH=%OHM_HOME%\Libs
set XMLRPC_PATH=%OHM_HOME%\Libs
set JAVAMAIL_PATH=%OHM_HOME%\Libs

set ALGFACT_CLASSPATH=.
set ALGFACT_CLASSPATH=%ALGFACT_CLASSPATH%;%RBNB_PATH%\rbnb.jar
set ALGFACT_CLASSPATH=%ALGFACT_CLASSPATH%;%RBNB_PATH%\source.jar
set ALGFACT_CLASSPATH=%ALGFACT_CLASSPATH%;%RBNB_PATH%\chat.jar
set ALGFACT_CLASSPATH=%ALGFACT_CLASSPATH%;%RPCPLUGINS_PATH%\rpcplugins.jar
set ALGFACT_CLASSPATH=%ALGFACT_CLASSPATH%;%ALGSERVER_PATH%
set ALGFACT_CLASSPATH=%ALGFACT_CLASSPATH%;%ALGSERVER_PATH%\alg_server.jar
set ALGFACT_CLASSPATH=%ALGFACT_CLASSPATH%;%XMLRPC_PATH%\xmlrpc-1.1.jar
set ALGFACT_CLASSPATH=%ALGFACT_CLASSPATH%;%JAVAMAIL_PATH%\mail.jar
set ALGFACT_CLASSPATH=%ALGFACT_CLASSPATH%;%JAVAMAIL_PATH%\activation.jar


set ALGFACT_ALGS=com.creare.algorithms.server.ChatHost com.creare.algorithms.server.Subsystem
set ALGFACT_ALGS=%ALGFACT_ALGS% AircraftAlert

set ALGFACT_NAME="AlgorithmFactory"


@echo on

"%JAVA_DIR%"\bin\java -mx128M -cp %ALGFACT_CLASSPATH% com.creare.algorithms.server.AlgorithmFactoryImpl -a %RBNB_ADDRESS% -n %ALGFACT_NAME% %ALGFACT_ALGS%

:END
@echo on
@pause